﻿<div>
	<div data-ng-show="canEdit() && !isViewingFavorites()" style="display: block;">


		<a style="display: inline-block;" class="action-link" data-ng-hide="folderModel.createNewFolder" data-ng-click="showCreateNewFolder()">
			<img src="../../../Content/images/folder_add2.png" />Add Folder</a>

		<span style="display: inline-block;" data-ng-show="folderModel.createNewFolder">
			<span>Create New Folder:</span>
			<input data-ng-model="folderModel.newFolderName" style="padding-left: 2px;" />
			<div style="display: block">
				<a class="action-link" data-ng-click="submitCreateNewFolder()">
					<img src="../../../Content/images/save.png" />Save</a>
				<a class="action-link" data-ng-click="cancelCreateNewFolder()">
					<img src="../../../Content/images/undo.png" />Cancel</a>
			</div>
		</span>

		<a style="display: inline-block;" class="action-link" data-ng-hide="model.currentFolder.path.length === 0 || folderModel.removeFolder" data-ng-click="showRemoveFolder()">
			<img src="../../../Content/images/folder_delete.png" />Remove Folder</a>

		<span style="display: inline-block;" data-ng-show="folderModel.removeFolder">
			<span>Remove Folder:</span>
			<div style="display: block">
				<a class="action-link" data-ng-click="submitRemoveFolder()">
					<img src="../../../Content/images/delete.png" />Remove?</a>
				<a class="action-link" data-ng-click="cancelRemoveFolder()">
					<img src="../../../Content/images/undo.png" />Cancel</a>
			</div>
		</span>

        <!--MOVE FOLDER-->

        <a style="display: inline-block;" class="action-link" data-ng-hide="model.currentFolder.path.length === 0 || folderModel.moveCurrentFolder" data-ng-click="showMoveFolder(0)">
		<img src="../../../Content/images/folder_move_new.png" />Move Folder</a>

		<span style="display: inline-block;" data-ng-show="folderModel.moveCurrentFolder">
			<span>Folder to Move: {{folderModel.moveFolder.Name}}</span><br />
            <span>Move to Folder: {{folderModel.currentFolder.Name}}</span><br />
			<div style="display: block">
				<a class="action-link" data-ng-click="submitMoveFolder()">
					<img src="../../../Content/images/save.png" />Move?</a>
				<a class="action-link" data-ng-click="cancelMoveFolder()">
					<img src="../../../Content/images/undo.png" />Cancel</a>
			</div>
		</span>
	</div>

	<h4>Folders:</h4>
	<div class="tree-view-container" data-ng-show="model.user.Id === model.authUser.Id">
		<ul>
			<li class="expanded-node">
				<img src="../../../Content/images/favorites.png" data-ng-hide="isViewingFavorites()" />
				<img src="../../../Content/images/favorites_s.png" data-ng-show="isViewingFavorites()" />
				<a data-ng-click="selectFolder(node)" href="/#/user/{{model.authUser.Id}}/view/favorites" class="ng-binding">Favorites</a>
			</li>
		</ul>
	</div>
	<p data-ng-show="folderModel.isLoading"><i>Loading...</i></p>
	<div
		data-ng-disabled="true"
		class="tree-view-container"
		data-tree-view=""
		data-items="folderModel.folders"
		data-node-id="Id"
		data-node-label="Name"
		data-node-children="Folders"
		data-toggle-node="toggleNode"
		data-select-node="selectFolder">
	</div>
</div>
